import 'package:get/get.dart';

class UserController extends GetxController {
  var userInfo = RxMap({});
  var userToken = RxString("");

  /// set user token
  void setUserToken(token) => userToken.value = token;

  /// set user info
  void setUserInfo(user_info) => userInfo.value = user_info;

  /// clear user token and user info
  void clearUserInfo() => {userInfo.value = {}, userToken.value = ""};

  /// check if user is logged in
  bool isLoggedIn() => userToken.value.isNotEmpty;
}
